package com.nosnow.edu.invoking;

import com.nosnow.common.utils.R;
import com.nosnow.edu.invoking.impl.VodClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author by bingHeng
 * @version 1.0
 * @Create 2020/4/12 0:30
 *
 * 调用service-vod模块的接口
 */

@FeignClient(name = "service-vod", fallback = VodClientImpl.class)
@Component
public interface VodClient {

    // 定义要调用方法的路径[根据视频Id，删除阿里云端视频]
    @DeleteMapping("/web/vod/video/removeAlyVideo/{id}")
    R removeAlyVideo(@PathVariable("id") String id); // @PathVariable("id")  该注解一定要指明参数名称，否则出错

    // 定义要远程调用方法的路径[根据视频id集合，批量删除阿里云端视频]
    @DeleteMapping("/web/vod/video/removeAlyVideos")
    R removeAlyVideos(@RequestParam("videoIdList") List<String> videoIdList);
}
